<?php

/*
config文件读取类
*/

class cfg
{
	protected $arr=null;
	protected static $ins=null;

	protected function __construct(){
		
	}
	public static function getIns()
	{
		if(self::$ins)
		{
			return self::$ins;
		}
		self::$ins=new self();
		require(ROOT.'include/conf.php');
		self::$ins->arr=$config;

		return self::$ins;
	}

	public function __get($k)
	{
		if(isset($this->arr[$k]))
		{
			return $this->arr[$k];
		}
		return false;
	}
	public function __set($k,$v)
	{
		if(isset($this->arr[$k]))
		{
			$this->arr[$k]=$v;
		}
	}

}


